package com.szsky.sky.task;

import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.szsky.sky.entity.portal.AppBindDevice;
import com.szsky.sky.mapper.portal.AppBindDeviceMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Slf4j
@Component
public class AppBindDeviceTask {

    @Resource
    private AppBindDeviceMapper appBindDeviceMapper;

    /**
     * 删除APP提审账号的绑定
     */
    @Scheduled(cron = "0 0/5 7-19 * * ?")
    private void delAppTestAccountBinding() {
//        log.info("删除APP提审账号的绑定-开始");
        LambdaUpdateWrapper<AppBindDevice> lam = new LambdaUpdateWrapper();
        lam.eq(AppBindDevice::getUserId, "76d6d938ffa646afb4d645d495d8c9e9");
        int i = appBindDeviceMapper.delete(lam);
//        log.info("删除APP提审账号的绑定-结束，删除数量：{}", i);

    }

}
